<template>
    <section class="index-notice">
        <div class="title">
            <div class="title-left">
                <span> 客户关怀 </span>
            </div>
            <div class="title-right">
                <el-radio-group v-model="radio1" size="small" @change="change1Fun">
                    <el-radio-button :label="1">今日</el-radio-button>
                    <el-radio-button :label="2">3日内</el-radio-button>
                    <el-radio-button :label="3">7日内</el-radio-button>

                </el-radio-group>
            </div>
        </div>
        <el-table :data="birthdaysInfo" style="width: 100%" stripe>
            <el-table-column prop="customer_name" label="客户名" />
            <el-table-column prop="name" label="联系人姓名" />
            <el-table-column prop="gander" label="性别" />
            <el-table-column prop="post" label="职务" />
            <el-table-column prop="mobile" label="手机号" />
            <el-table-column prop="birthdate" label="生日" />

        </el-table>


        <el-button type="primary" round class="btn" @click="router.back()">
            <el-icon>
                <IEpBack />
            </el-icon>
            返回上一页
        </el-button>
    </section>
</template>
<script setup>
import {
    birthdaysApi
} from "@/plugins/api/home";
const router = useRouter();
// 客户回款提醒
let radio1 = ref('1')
function change1Fun() {
    getBirthdays()
}
// 客户关怀，客户联系人生日提醒
let birthdaysInfo = ref([]);
function getBirthdays() {
    birthdaysApi({
        dayLimit: radio1.value
    }).then((data) => {
        birthdaysInfo.value = [...data];
    });
}
onMounted(() => {
    getBirthdays()
});
</script>
<style scoped lang="scss">
.index-notice {

    .title {
        width: 100%;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #aaa6a699;
        line-height: 40px;

        .title-left {
            align-self: center;
            margin-left: 10px;

            span {
                font-size: 18px;
                font-weight: 600;
            }
        }

        .title-right {
            align-self: center;
            margin-right: 10px;

            span {
                font-size: 12px;
                color: #676B80;
                cursor: pointer;
            }
        }
    }

    .btn {
        margin-top: 20px;
    }
}
</style>